Kaya (programming language)

Kaya
Appeared in 2004
Designed by Edwin Brady
Developer Durham University Computing Society
Stable release 0.5.1 (2 August 2008)
Typing discipline Static, strong, and inferred
Major implementations Kaya
Influenced by Haskell, Objective Caml, and C
OS Windows, Mac OS, Linux, and others
License GNU GPL license
Website kayalang.org

Kaya is a programming language with a powerful type system, static type checking and type inference.

Contents

Overview

Kaya is a compiled language with a powerful and unobtrusive type system, allowing many bugs to be found at compile time. Type inference means that the need to explicitly write types down is minimised, while polymorphic records and functions, together with ad-hoc function overloading, allow easy writing of general functions.

Kaya allows functions to be partially applied, with the remaining parameters completed later. This allows easy development of generalised functions, evaluation of expensive functions to be postponed until necessary, and separation of program code into logical chunks to be done without sacrificing efficiency. Anonymous functions (lambda functions) are also supported.

Kaya includes extensive pattern matching capabilities, allowing analysis of complex data structures and extraction of needed variables to be expressed more readably than via a sequence of nested if statements. Complex data types may be aliased to type synonyms, to improve the readability of code, and to allow for implementation changes.

There are several primitive types, including automatically sized multi-dimensional arrays. There is a large standard library containing modules for processing user input, database access with a cross-database API, image generation with libgd, regular expressions and many features for web development.

Implementation

Kaya is cross-platform, available for Linux, Mac OS X and Windows, and should work on any other POSIX-compliant system. Programs written in Kaya can be compiled on any of these operating systems, and can run on a wide variety of hardware architectures.

Other features

Examples

Hello world:

program hello;
 
Void main() {
    // My first program!
    putStrLn("Hello world!");
}

A Simple Web Application:

webapp webhello;
 
import Webapp;
import HTMLDocument;
 
HTMLDocument webmain() {
    doc = HTMLDocument::new(HTML4Strict,"Hello Web!");
    h1 = addHeading(doc.body,1,"Hello Web!");
 
    return doc;
}

External links